package com.lej.dataservice.club.bean.main.home

/**
 *  author: cjq
 *  date  : 2022/7/18 0018
 *  desc  :
 *
 *  {
"data": {
"id": "",
"nft_id": "藏品id",
"time_timestamp": "订单时间戳",
"time_format": "订单时间展示格式",
"order_no": "订单号",
"price": "nft价格（分）",
"quantity": "购买数量",
"fee": "总价（分）",
"nft_author": "藏品创作者",
"nft_type": "藏品类型",
"nft_name": "藏品名",
"cover": "藏品展示图",
"transfer_status": "状态0求购中1成功2未成功"
}
}
 */
data class OrderDetailInfo(
    val id: Int?,
    val nft_id: Int?,
    val time_timestamp: Long?,
    val time_format: String?,
    val order_no: String?,
    val quantity: Int?,
    val price: Int?,
    val fee: Int?,
    val nft_author: String?,
    val nft_type: Int?,
    val nft_name: String?,
    val transfer_status: Int?,
    val cover: String?
){
    fun getNftType() =
        when (nft_type) {
            1 -> "图片"
            2 -> "音频"
            3 -> "视频"
            4 -> "模型"
            else -> "图片"
        }

    fun getStateStr() =
        when (transfer_status) {
            0 -> "求购中,还没有藏家同意出售"
            1 -> "交易完成"
            2 -> "求购失败"
            else -> "获取订单状态失败"
        }
}
